package old.day20190318.dao;

import java.util.List;

/**
 * @author DingZhenYun
 * @create 2019-03-20 9:04
 */
public class DaoTest {
    public static void main(String[] args) {
        DAO dao=new DAO();
        String sql3="update examstudent set Type=? where FileId=?";
        dao.update(sql3,1,1);
        System.out.println();
        String sql = "SELECT FileId flowId, Type type, IDCard idCard, ExamCard examCard, StudentName studentName, Location location, Grade grade FROM examstudent WHERE FileId = ?";
        ExamStudent es=dao.get(ExamStudent.class,sql,1);
        System.out.println(es);
        System.out.println();
        String sql1 = "SELECT FileId flowId, Type type, IDCard idCard, ExamCard examCard, StudentName studentName, Location location, Grade grade FROM examstudent ";
       List<ExamStudent> es1 =dao.getForList(ExamStudent.class,sql1);
        System.out.println(es1);

        //一条记录的
        String sql4="select IDCard from examstudent where FileId=?";
        int exaa=dao.getForValue(sql,12);
        System.out.println(exaa);

        String sql5="select count(*) from examstudent";
        long sum=dao.getForValue(sql5);
        System.out.println(sum);
    }
}
